﻿@model SetupViewModel
@{
    ViewBag.Title = "We-Blog | " + Strings.Setup_GetStarted;
    Layout = "_Setup.cshtml";    
}

@section head {
    <script type="text/javascript">
        $(document).ready(function () {
            $("#connectionString").hide();

            $(".storageOption").click(function () {
                if ($(this).val() == "2") {
                    $("#connectionString").show();
                }
                else {
                    $("#connectionString").hide();
                }
            });
        });
    </script>
}

<h2>@Strings.Setup_Welcome</h2>
@using (Html.BeginForm()) { 
    <fieldset class="shaded setup">
        <legend>@Strings.Setup_GetStarted</legend>        
        <p>@Strings.Setup_Directions</p>
        <br />
        <div class="editor-label">
            <label>@Strings.Setup_BlogNameLabel</label>    
        </div>
        <div class="editor-field">
            @Html.TextBoxFor(x => x.Config.Name)
            @Html.ValidationMessageFor(x => x.Config.Name)
        </div>        

         <div class="editor-label">
            <label>@Strings.Setup_BlogUrlLabel</label>    
        </div>
        <div class="editor-field">
            @Html.TextBoxFor(x => x.Config.HostHeaderValues, new { size = 30 })
            @Html.ValidationMessageFor(x => x.Config.HostHeaderValues)
            <p class="example">
                e.g: http://www.myblog.com
            </p>    
        </div>

        <div class="editor-label">
            <label>@Strings.Setup_BlogDescriptionLabel</label>    
        </div>
        <div class="editor-field">
            @Html.TextBoxFor(x => x.Config.Description, new { size = 50 })
            @Html.ValidationMessageFor(x => x.Config.Description)
        </div>

        <div class="editor-label">
            <label>@Strings.Setup_AdminEmailLabel</label>    
        </div>
        <div class="editor-field">
            @Html.TextBoxFor(x => x.AdminEmail, new { size = 50 })
            @Html.ValidationMessageFor(x => x.AdminEmail)
        </div>

        <div class="editor-label">
            <label>@Strings.Setup_PasswordLabel</label>    
        </div>
        <div class="editor-field">
            @Html.PasswordFor( x => x.Password )
            @Html.ValidationMessageFor(x => x.Password)
        </div>

        <div class="editor-label">
            <label>@Strings.Setup_ConfirmPasswordLabel</label>    
        </div>
        <div class="editor-field">
            @Html.PasswordFor(x => x.ConfirmPassword)
            @Html.ValidationMessageFor(x => x.ConfirmPassword)
        </div>

        <div class="editor-label">
            <label>@Strings.Setup_DataStorageLabel</label>    
        </div>
        <div class="editor-field">            
            @foreach( var item in Model.StorageOptions ) {                
                @Html.RadioButton( "StorageOptionId", item.Value, item.Selected, new { @class = "storageOption" } ) @item.Text<br />
            }
        </div>   
        
        <div id="connectionString">
            <div class="editor-label">
                <label>@Strings.Setup_ConnectionStringLabel</label>    
            </div>

            <div class="editor-field">
                @Html.TextBoxFor(x => x.SqlConnectionString, new { size = 75 })
                @Html.ValidationMessageFor(x => x.SqlConnectionString)

                <p class="example">
                    e.g: Data Source=sqlServerName;Initial Catalog=WeBlog;Integrated Security=SSPI
                </p>                
            </div>
        </div>    
    
        <div class="buttons">
            <input type="submit" value="@Strings.Setup_FinishText" />
        </div>
    </fieldset>
}